<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新增图书</title>
</head>
<body>
<form id="fm" th:action="@{/addBook}" method="post" enctype="multipart/form-data">
  <table border="1">
    <tr>
      <th colspan="2" ><h2>添加图书信息</h2></th>
    </tr>
    <tr>
      <td>图书书名(*)</td>
      <td><input type="text" id="name" name="name"></td>
    </tr>
    <tr>
      <td>图书库存(*)</td>
      <td><input type="text"  name="pnum"></td>
    </tr>
    <tr>
      <td>图书价格(*)</td>
      <td><input type="text"  name="price"></td>
    </tr>
    <tr>
      <td>图书类目(*)</td>
      <td> <input type="text" name="category">  </td>
    </tr>
    <tr>
      <td>图书说明(*)</td>
      <td><input type="text" name="description"></td>
    </tr>
    <tr>
      <td>图书图片(*)</td>
      <td><input type="file"  name="file">
        <span th:text="${error}"></span>
      </td>
    </tr>
    <tr>
      <td>图书作者(*)</td>
      <td><input type="text"  name="author"></td>
    </tr>
    <tr>
      <td>图书已售(*)</td>
      <td><input type="text"  name="sales"></td>
    </tr>
    <tr style="text-align: center">
      <td colspan="2"><input type="submit" value="添加">
        <input type="button" value="返回" onclick="backIndex()">
      </td>
      <script>
        function  backIndex(){
          location.href='http://localhost:8080/index';
        }
      </script>
    </tr>
  </table>
</form>
</body>
</html>